<!-- 加上setup允许直接在script中编写组合式API -->
<!-- <script>
export default {
  setup() {
    // console.log("setup函数");
    const message = "Vue3"
    const getMessage = () =>{
      console.log(message)
    }

    return {
      message,
      getMessage
    }
  },
  beforeCreate() {
    console.log('beforeCreate')
  },
}
</script> -->

<script setup>
  const message = "Vue3"
  const getMessage = () =>{
    console.log(message)
  }
</script>

<template>
  <div>{{ message }}</div>
  <button @click="getMessage">按钮</button>
</template>
